/**
 * 2012-7-8
 * jqsl2012@163.com
 */
package net.jeeshop.services.front.appointments.dao.impl;

import net.jeeshop.core.dao.BaseDao;
import net.jeeshop.core.dao.page.PagerModel;
import net.jeeshop.services.front.appointments.bean.Appointments;
import net.jeeshop.services.front.appointments.dao.AppointmentsDao;

import java.util.List;


/**
 * @author huangf
 */
public class AppointmentsDaoImpl implements AppointmentsDao {
	private BaseDao dao;

	public void setDao(BaseDao dao) {
		this.dao = dao;
	}

	public PagerModel selectPageList(Appointments e) {
		return dao.selectPageList("front.Appointments.selectPageList",
				"front.Appointments.selectPageCount", e);
	}

	public List selectList(Appointments e) {
		return dao.selectList("front.Appointments.selectList", e);
	}

	public Appointments selectOne(Appointments e) {
		return (Appointments) dao.selectOne("front.Appointments.selectOne", e);
	}

	public int delete(Appointments e) {
		return dao.delete("front.Appointments.delete", e);
	}

	public int update(Appointments e) {
		return  dao.update("front.Appointments.update", e);
	}

	/**
	 * 批量删除用户
	 * 
	 * @param ids
	 */
	public int deletes(String[] ids) {
		Appointments e = new Appointments();
		for (int i = 0; i < ids.length; i++) {
			e.setId(ids[i]);
			delete(e);
		}
		return 0;
	}

	public int insert(Appointments e) {
		return dao.insert("front.Appointments.insert", e);
	}

	/**
	 * @param bInfo
	 */
	public List<Appointments> getLoseList(Appointments bInfo) {
		return dao.selectList("front.Appointments.getLoseList", bInfo);
	}

	@Override
	public List<Appointments> selecIndexAppointments(Appointments e) {
		return dao.selectList("front.Appointments.selecIndexAppointments", e);
	}

	@Override
	public int deleteById(int id) {
		return dao.delete("front.Appointments.deleteById",id);
	}

	@Override
	public List<String> selectAllMd5() {
		return dao.selectList("front.Appointments.selectAllMd5");
	}

	@Override
	public void updateInBlackList(String e) {
		// TODO Auto-generated method stub
		dao.update("updateInBlackList",e);
	}

	@Override
	public void sync(Appointments appointments) {
		// TODO Auto-generated method stub
		dao.update("front.Appointments.sync",appointments);
	}
	
	public Appointments selectById(String id) {
		return (Appointments) dao.selectOne("front.Appointments.selectById", id);
	}

	@Override
	public List<Appointments> selectNoticeList(Appointments appointments) {
		return dao.selectList("front.Appointments.selectNoticeList",appointments);
	}

	@Override
	public Appointments selectSimpleOne(Appointments appointments) {
		return (Appointments) dao.selectOne("front.Appointments.selectSimpleOne", appointments);
	}
}
